package com.ruoyi.procured.service;

import java.util.List;

import com.ruoyi.common.core.domain.ProcuredOrders;
import com.ruoyi.procured.domain.ProcuredPlan;
import com.ruoyi.procured.domain.ProcuredProduct;
import com.ruoyi.procured.domain.TbProcuredProduct;
import com.ruoyi.sale.domain.Plan;
import org.apache.ibatis.annotations.Param;

/**
 * 采购计划Service接口
 * 
 * @author ruoyi
 * @date 2023-11-03
 */
public interface IProcuredPlanService 
{
    /**
     * 查询采购计划
     * 
     * @param planId 采购计划主键
     * @return 采购计划
     */
    public ProcuredPlan selectProcuredPlanByPlanId(Long planId);

    /**
     * 查询采购计划列表
     * 
     * @param procuredPlan 采购计划
     * @return 采购计划集合
     */
    public List<ProcuredPlan> selectProcuredPlanList(ProcuredPlan procuredPlan);

    /**
     * 新增采购计划
     * 
     * @param procuredPlan 采购计划
     * @return 结果
     */
    public int insertProcuredPlan(ProcuredPlan procuredPlan, Long userId, String componentPath);

    /**
     * 修改采购计划
     * 
     * @param procuredPlan 采购计划
     * @return 结果
     */
    public int updateProcuredPlan(ProcuredPlan procuredPlan);


    /**
     * 批量删除采购计划
     * 
     * @param planIds 需要删除的采购计划主键集合
     * @return 结果
     */
    public int deleteProcuredPlanByPlanIds(Long[] planIds);

    /**
     * 删除采购计划信息
     * 
     * @param planId 采购计划主键
     * @return 结果
     */
    public int deleteProcuredPlanByPlanId(Long planId);

    /**
     * 核准
     * @param planIds
     * @param flay
     * @param approver
     * @return
     */
    public int updateProcuredPlanStatus(Long[] planIds,boolean flay,String approver);

    /**
     * 查询采购产品列表
     *
     * @param tbProcuredProduct 采购产品
     * @return 采购产品集合
     */
    public List<TbProcuredProduct> selectTbProcuredProductList(TbProcuredProduct tbProcuredProduct);

    /**
     * 批量查询采购产品数据
     * @param ids 根据id来查
     * @return 结果
     */
    public List<TbProcuredProduct> selectTbProcuredProductListById(Long[] ids);

    /**
     * 修改是否选择状态
     * @param ids
     * @param flay
     * @return
     */
    public int updateProcuredProductSelectedStatus(Long[] ids,boolean flay);

    /**
     * 生成采购单号数据
     * @param procuredPlan
     * @param nickname
     * @return
     */
    public int insertProcuredOrders(ProcuredPlan procuredPlan,String nickname);

    /**
     * 删除撤销的数据
     * @param ordersNumbers
     * @return
     */
    public int deleteProcuredOrdersByOrdersNumber(String[] ordersNumbers);

    /**
     * 撤销下单的时候修改计划状态
     * @param ordersNumbers
     * @param flay
     * @return
     */
    public int updateProcuredPlanOrdersNumber(String[] ordersNumbers ,boolean flay);


    /**
     * 采购计划详情页面查询
     * @param procuredOrders
     * @return
     */
    List<ProcuredOrders> selectProcuredPlanByDetails(ProcuredOrders procuredOrders);
    /**
     * 待我审核的采购计划
     * @param procuredPlan
     * @return 结果
     */
    public List<ProcuredPlan> getPlanWaitProcuredProcessList(ProcuredPlan procuredPlan);

    /**
     * 获取采购计划采购商品的详细
     */
    ProcuredPlan getPlanProducts(Long planId);
}
